/*
 * Copyright the original author or authors.
 * 
 * Licensed under the MOZILLA PUBLIC LICENSE, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.mozilla.org/MPL/MPL-1.1.html
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.customactions.flexunit.view 
{
	import net.pixlib.events.EventChannel;
	import net.pixlib.log.LogLevel;
	import net.pixlib.log.Logger;

	import flash.utils.getQualifiedClassName;

	/**
	 * The PixLogView class display testing XML result using 
	 * <strong>Pixlib</strong> Logging API.
	 * 
	 * @includeExample TraceViewExample.as -noswf
	 * 
	 * @author Romain Ecarnot
	 * 
	 * @langversion 3.0
	 * @playerversion Flash 10
	 * @playerversion AIR 1.5
	 * @productversion FDT 3.5
	 */
	public class PixLogView implements XMLReportView 
	{
		//--------------------------------------------------------------------
		// Private properties
		//--------------------------------------------------------------------
		
		/**
		 * @private
		 * Custom event channel
		 */
		private var _channel : EventChannel; 
		
		
		//--------------------------------------------------------------------
		// Public properties
		//--------------------------------------------------------------------
		
		/**
		 * Returns EventChannel used for logging.
		 *
		 * @langversion 3.0
		 * @playerversion Flash 10
		 * @playerversion AIR 1.5
		 * @productversion FDT 3.5
		 */
		public function get channel() : EventChannel
		{
			return _channel;
		}
		

		//--------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------
		
		/**
		 * Creates instance.
		 *
		 * @langversion 3.0
		 * @playerversion Flash 10
		 * @playerversion AIR 1.5
		 * @productversion FDT 3.5
		 */
		public function PixLogView()
		{
			_channel = new PixLogViewChannel();
		}
		
		/**
		 * @inheritDoc
		 * 
		 * @langversion 3.0
		 * @playerversion Flash 10
		 * @playerversion AIR 1.5
		 * @productversion FDT 3.5
		 */
		public function process(data : XML) : void
		{
			Logger.LOG(data, LogLevel.INFO, _channel, this);
		}
		
		/**
		 * Returns String representation of instance.
		 *
		 * @return String representation of instance.
		 * 
		 * @langversion 3.0
		 * @playerversion Flash 10
		 * @playerversion AIR 1.5
		 * @productversion FDT 3.5
		 */
		public function toString() : String
		{
			return getQualifiedClassName(this) + "[" + _channel.toString() + "]";
		}
	}
}

import net.pixlib.events.EventChannel;

internal class PixLogViewChannel extends EventChannel
{
}